// This file is part of Acala.

// Copyright (C) 2020-2025 Acala Foundation.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for module_incentives
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-05, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `ip-172-31-47-44`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024

// Executed Command:
// target/release/acala
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=module_incentives
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./modules/incentives/src/weights.rs
// --template=./templates/module-weight-template.hbs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use sp_std::marker::PhantomData;

/// Weight functions needed for module_incentives.
pub trait WeightInfo {
	fn on_initialize(c: u32, ) -> Weight;
	fn deposit_dex_share() -> Weight;
	fn withdraw_dex_share() -> Weight;
	fn claim_rewards() -> Weight;
	fn update_incentive_rewards(c: u32, ) -> Weight;
	fn update_claim_reward_deduction_rates(c: u32, ) -> Weight;
	fn update_claim_reward_deduction_currency() -> Weight;
}

/// Weights for module_incentives using the Acala node and recommended hardware.
pub struct AcalaWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for AcalaWeight<T> {
	// Storage: `EmergencyShutdown::IsShutdown` (r:1 w:0)
	// Proof: `EmergencyShutdown::IsShutdown` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
	// Storage: `Rewards::PoolInfos` (r:5 w:0)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Incentives::IncentiveRewardAmounts` (r:8 w:0)
	// Proof: `Incentives::IncentiveRewardAmounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:0)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	/// The range of component `c` is `[0, 4]`.
	fn on_initialize(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1476 + c * (384 ±0)`
		//  Estimated: `5007 + c * (5027 ±13)`
		// Minimum execution time: 13_440 nanoseconds.
		Weight::from_parts(19_271_096, 5007)
			// Standard Error: 190_479
			.saturating_add(Weight::from_parts(24_655_412, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().reads(2))
			.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 5027).saturating_mul(c.into()))
	}
	// Storage: `Tokens::Accounts` (r:2 w:2)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `EvmAccounts::EvmAddresses` (r:1 w:0)
	// Proof: `EvmAccounts::EvmAddresses` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `MaxEncodedLen`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn deposit_dex_share() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2855`
		//  Estimated: `6320`
		// Minimum execution time: 98_848 nanoseconds.
		Weight::from_parts(100_717_000, 6320)
			.saturating_add(T::DbWeight::get().reads(6))
			.saturating_add(T::DbWeight::get().writes(5))
	}
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::Accounts` (r:2 w:2)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `System::Account` (r:1 w:0)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn withdraw_dex_share() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2945`
		//  Estimated: `6410`
		// Minimum execution time: 97_599 nanoseconds.
		Weight::from_parts(99_107_000, 6410)
			.saturating_add(T::DbWeight::get().reads(5))
			.saturating_add(T::DbWeight::get().writes(4))
	}
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Incentives::PendingMultiRewards` (r:1 w:1)
	// Proof: `Incentives::PendingMultiRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Incentives::ClaimRewardDeductionRates` (r:1 w:0)
	// Proof: `Incentives::ClaimRewardDeductionRates` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Incentives::ClaimRewardDeductionCurrency` (r:1 w:0)
	// Proof: `Incentives::ClaimRewardDeductionCurrency` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `EvmAccounts::EvmAddresses` (r:1 w:0)
	// Proof: `EvmAccounts::EvmAddresses` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `MaxEncodedLen`)
	fn claim_rewards() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2633`
		//  Estimated: `6098`
		// Minimum execution time: 143_679 nanoseconds.
		Weight::from_parts(146_283_000, 6098)
			.saturating_add(T::DbWeight::get().reads(7))
			.saturating_add(T::DbWeight::get().writes(4))
	}
	// Storage: `Incentives::IncentiveRewardAmounts` (r:4 w:4)
	// Proof: `Incentives::IncentiveRewardAmounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `c` is `[0, 4]`.
	fn update_incentive_rewards(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `760 + c * (94 ±0)`
		//  Estimated: `2033 + c * (2475 ±0)`
		// Minimum execution time: 6_569 nanoseconds.
		Weight::from_parts(10_367_012, 2033)
			// Standard Error: 121_237
			.saturating_add(Weight::from_parts(11_986_144, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 2475).saturating_mul(c.into()))
	}
	// Storage: `Incentives::ClaimRewardDeductionRates` (r:4 w:4)
	// Proof: `Incentives::ClaimRewardDeductionRates` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `c` is `[0, 4]`.
	fn update_claim_reward_deduction_rates(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `676 + c * (10 ±0)`
		//  Estimated: `1698 + c * (2475 ±0)`
		// Minimum execution time: 6_582 nanoseconds.
		Weight::from_parts(7_678_403, 1698)
			// Standard Error: 25_846
			.saturating_add(Weight::from_parts(3_067_233, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 2475).saturating_mul(c.into()))
	}
	// Storage: `Incentives::ClaimRewardDeductionCurrency` (r:1 w:1)
	// Proof: `Incentives::ClaimRewardDeductionCurrency` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn update_claim_reward_deduction_currency() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1043`
		//  Estimated: `4508`
		// Minimum execution time: 24_712 nanoseconds.
		Weight::from_parts(25_404_000, 4508)
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
}

// For backwards compatibility and tests
impl WeightInfo for () {
	// Storage: `EmergencyShutdown::IsShutdown` (r:1 w:0)
	// Proof: `EmergencyShutdown::IsShutdown` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
	// Storage: `Rewards::PoolInfos` (r:5 w:0)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Incentives::IncentiveRewardAmounts` (r:8 w:0)
	// Proof: `Incentives::IncentiveRewardAmounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:0)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	/// The range of component `c` is `[0, 4]`.
	fn on_initialize(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1476 + c * (384 ±0)`
		//  Estimated: `5007 + c * (5027 ±13)`
		// Minimum execution time: 13_440 nanoseconds.
		Weight::from_parts(19_271_096, 5007)
			// Standard Error: 190_479
			.saturating_add(Weight::from_parts(24_655_412, 0).saturating_mul(c.into()))
			.saturating_add(RocksDbWeight::get().reads(2))
			.saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 5027).saturating_mul(c.into()))
	}
	// Storage: `Tokens::Accounts` (r:2 w:2)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `EvmAccounts::EvmAddresses` (r:1 w:0)
	// Proof: `EvmAccounts::EvmAddresses` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `MaxEncodedLen`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn deposit_dex_share() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2855`
		//  Estimated: `6320`
		// Minimum execution time: 98_848 nanoseconds.
		Weight::from_parts(100_717_000, 6320)
			.saturating_add(RocksDbWeight::get().reads(6))
			.saturating_add(RocksDbWeight::get().writes(5))
	}
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::Accounts` (r:2 w:2)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `System::Account` (r:1 w:0)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn withdraw_dex_share() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2945`
		//  Estimated: `6410`
		// Minimum execution time: 97_599 nanoseconds.
		Weight::from_parts(99_107_000, 6410)
			.saturating_add(RocksDbWeight::get().reads(5))
			.saturating_add(RocksDbWeight::get().writes(4))
	}
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Incentives::PendingMultiRewards` (r:1 w:1)
	// Proof: `Incentives::PendingMultiRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Incentives::ClaimRewardDeductionRates` (r:1 w:0)
	// Proof: `Incentives::ClaimRewardDeductionRates` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Incentives::ClaimRewardDeductionCurrency` (r:1 w:0)
	// Proof: `Incentives::ClaimRewardDeductionCurrency` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `EvmAccounts::EvmAddresses` (r:1 w:0)
	// Proof: `EvmAccounts::EvmAddresses` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `MaxEncodedLen`)
	fn claim_rewards() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2633`
		//  Estimated: `6098`
		// Minimum execution time: 143_679 nanoseconds.
		Weight::from_parts(146_283_000, 6098)
			.saturating_add(RocksDbWeight::get().reads(7))
			.saturating_add(RocksDbWeight::get().writes(4))
	}
	// Storage: `Incentives::IncentiveRewardAmounts` (r:4 w:4)
	// Proof: `Incentives::IncentiveRewardAmounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `c` is `[0, 4]`.
	fn update_incentive_rewards(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `760 + c * (94 ±0)`
		//  Estimated: `2033 + c * (2475 ±0)`
		// Minimum execution time: 6_569 nanoseconds.
		Weight::from_parts(10_367_012, 2033)
			// Standard Error: 121_237
			.saturating_add(Weight::from_parts(11_986_144, 0).saturating_mul(c.into()))
			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(c.into())))
			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 2475).saturating_mul(c.into()))
	}
	// Storage: `Incentives::ClaimRewardDeductionRates` (r:4 w:4)
	// Proof: `Incentives::ClaimRewardDeductionRates` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `c` is `[0, 4]`.
	fn update_claim_reward_deduction_rates(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `676 + c * (10 ±0)`
		//  Estimated: `1698 + c * (2475 ±0)`
		// Minimum execution time: 6_582 nanoseconds.
		Weight::from_parts(7_678_403, 1698)
			// Standard Error: 25_846
			.saturating_add(Weight::from_parts(3_067_233, 0).saturating_mul(c.into()))
			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(c.into())))
			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 2475).saturating_mul(c.into()))
	}
	// Storage: `Incentives::ClaimRewardDeductionCurrency` (r:1 w:1)
	// Proof: `Incentives::ClaimRewardDeductionCurrency` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn update_claim_reward_deduction_currency() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1043`
		//  Estimated: `4508`
		// Minimum execution time: 24_712 nanoseconds.
		Weight::from_parts(25_404_000, 4508)
			.saturating_add(RocksDbWeight::get().reads(1))
			.saturating_add(RocksDbWeight::get().writes(1))
	}
}
